﻿<%@ Page Title="" Language="C#" MasterPageFile="~/sunt_AJAX.Master" AutoEventWireup="true" CodeBehind="sunt_UpdataPanel_Dynamic.aspx.cs" Inherits="sunt.AJAX.Demo.sunt.UpdataPanel.sunt_UpdataPanel_Dynamic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>以编程的方式填充UpdataPanel</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<ul>
    <li>可更新面板的内容是通过模板属性（ContentTemplate）定义的，与其他ASP.NET控件类似，也可以编程的方式设置</li>
    <li>在代码隐藏类中，我们要在PrnInit事件的处理程序中设置ContenerTemplate</li>
    <li>protected void Page_PreInit(object sender, EventArgs e)
        {
            string ascx = "myUserControl.ascx";
            this.UpdatePanel1.ContentTemplate = this.LoadComplete(ascx);
        }</li>

</ul>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        
    </asp:UpdatePanel>
</asp:Content>
